<template>
	<view>
		{{listParams.list}}
	</view>
</template>

<script setup>
import { ref, reactive, onMounted, watchEffect, watch } from 'vue';
import { onLoad, onPageScroll, onReady, onReachBottom } from '@dcloudio/uni-app';
import initApi from '@/apis/init.js';

const listParams = reactive({
	search: {
		pageNum: 1,
		pageSize: 20,
		bbsLoadStatus: 'loading',
		condition: {
			orderNo: null,
		}
	},
	list: []
});
onLoad((query)=>{
	console.log(query);
	if(query.orderNo){
		listParams.search.condition.orderNo= query.orderNo
	}
	getData()
})

const getData=async()=>{
	listParams.search.bbsLoadStatus = 'loading'
	try{
		const res = await initApi.getPaymentInfoPage(listParams.search)
		if(res.code == 20000){
			let bbs = listParams.pageNum == 1 ? res.data.records : [...listParams.list, ...res.data.records];
			listParams.list = bbs;
			listParams.search.bbsLoadStatus = res.data.records.length < 20 ? 'noMore' : 'more';
		}
	}catch(e){
		//TODO handle the exception
	}
}
</script>

<style>

</style>
